﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Code4WP7SDK;

namespace LuWeibo.Models
{
    public class Comments : BaseModel
    {
        private string _created_at; //评论创建时间 
        private Int64 _id;//评论的ID
        private string _text;//评论的内容 
        private string _source;//评论的来源 
        private string _idstr;//
        private Int64 _mid;//评论的MID
        private User _user;//评论作者的用户信息字段
        private Status _status;//评论的微博信息字段
        private string _statusText; //将微博信息截取默认70个字节

        public string created_at
        {
            get { return MonthHelper.ConvertEnglistDate(_created_at); }
            set
            {
                _created_at = value;
                this.NotifyPropertyChanged(p => p.created_at);
            }
        }

        public Int64 id
        {
            get { return _id; }
            set
            {
                _id = value;
                this.NotifyPropertyChanged(p => p.id);
            }
        }

        public string text
        {
            get { return _text; }
            set
            {
                _text = value;
                this.NotifyPropertyChanged(p => p.text);
            }
        }

        public string source
        {
            get { return HtmlHelper.ParseTags(_source); }
            set
            {
                _source = value;
                this.NotifyPropertyChanged(p => p.source);
            }
        }

        public string idstr
        {
            get { return _idstr; }
            set
            {
                _idstr = value;
                this.NotifyPropertyChanged(p => p.idstr);
            }
        }

        public Int64 mid
        {
            get { return _mid; }
            set
            {
                _mid = value;
                this.NotifyPropertyChanged(p => p.mid);
            }
        }

        public User user
        {
            get { return _user; }
            set
            {
                _user = value;
                this.NotifyPropertyChanged(p => p.user);
            }
        }

        public Status status
        {
            get { return _status; }
            set
            {
                _status = value;
                this.NotifyPropertyChanged(p => p.status);
            }
        }

        public string statusText
        {
            get
            {
                _statusText = HtmlHelper.GetStr(this.status.text, 140);
                return _statusText;
            }
            set
            {
                _statusText = value;
                this.NotifyPropertyChanged(p => p.statusText);
            }
        }
    }
}
